package com.yang.libs.api

import com.xxx.lib.bean.ResponseBean
import com.xxx.lib.net.helper.RetrofitOkHttpHelper
import com.yang.libs.bean.MainBean
import com.yang.libs.bean.UploadBean
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST

/**
 * App的api
 */
object AppApi {

    val api: Api by lazy {
        RetrofitOkHttpHelper.retrofit.create(Api::class.java)
    }


    interface Api {
        /**
         * 获取商城数据
         */
        @GET("api/weather/view?stationid=59287")
        fun getMainData(): Observable<ResponseBean<MainBean>>

        /**
         * 上传图片
         */
        @POST("index.php/api/user/uploadimg")
        fun uploadImg(@Body img: RequestBody): Observable<ResponseBean<UploadBean>>
    }

}
